/**
 * Copyright (c) 2006-2007 Jinyi.lu
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of GNU LGPL license by gun.org
 * which accompanies this distribution, and is available at
 * http://gnu.feld-it.at/copyleft/lesser.html
 * 
 * Project Homepage : http://code.google.com/p/demou
 * Source Code: svn checkout http://demou.googlecode.com/svn/trunk/ demou
 * Mailing list : jinyi.lu@gmail.com
 *                stonelu@126.com
 *
 *  
 * Contributors:
 *     JinYi.Lu - initial API and implementation
 */
package cn.tworen.demou.remoting.cmd;

import java.util.Map;

/**
 * Created on  2007-2-26
 *
 * Title       : ErrorCmd.java
 * Description : 
 * 
 * @author     : LuJinYi
 * @version    : 1.0
 * @Date       : 2007-2-26
 * History     : 
 * 
 */
public class ErrorCmd<T> extends BaseCmd<T>{   
	public ErrorCmd(Throwable t){
		this.setFaultCode((T)Integer.valueOf(t.hashCode()));
		this.setFaultDetail((T)t.getLocalizedMessage());
		this.setFaultString((T)t.getMessage());
		this.setRootCause((T)t.getCause());
	}
	public T getFaultCode() {
		return this.getFixed("faultCode");
	}
	public void setFaultCode(T faultCode) {
		this.setFixed("faultCode", faultCode);
	}
	public T getFaultString() {
		return this.getFixed("faultString");
	}
	public void setFaultString(T faultString) {
		this.setFixed("faultString", faultString);
	}
	public T getFaultDetail() {
		return this.getFixed("faultDetail");
	}
	public void setFaultDetail(T faultDetail) {
		this.setFixed("faultDetail", faultDetail);
	}
	public T getRootCause() {
		return this.getFixed("rootCause");
	}
	public void setRootCause(T rootCause) {
		this.setFixed("rootCause", rootCause);
	}
	public T getExtendedData() {
		return this.getFixed("extendedData");
	}
	public void setExtendedData(T extendedData) {
		this.setFixed("extendedData", extendedData);
	}
}
